package com.hongxun.design.bean;

import com.baidu.mapapi.model.LatLng;

import com.hongxun.design.jbean.JReconnaissanceBean;
import com.hongxun.design.mytools.MyDecimalFormat;

/**
 * Created by zerdoor_pc on 2016/5/5.
 * 踏勘
 */
public class ReconnaissanceBean {

    public String type;
    public boolean isnewbulid;
    public LatLng currentPt;
    public String altitude;//海拔
    public String accuracy;//精度
    public String strength;//信号强度
    public String strengthValue;//信号强度数字
    public String pointType;//点位类型
    public String pointName;//点位名字

    public String getPointName() {
        return pointName;
    }

    public void setPointName(String pointName) {
        this.pointName = pointName;
    }

    public String getPointType() {
        return pointType;
    }

    public void setPointType(String pointType) {
        this.pointType = pointType;
    }

    public ReconnaissanceBean(){}
    public ReconnaissanceBean(String type, boolean isnewbulid, LatLng currentPt, String altitude, String accuracy,  String strengthValue) {
        this.type = type;
        this.isnewbulid = isnewbulid;
        this.currentPt = currentPt;
        this.altitude = altitude;
        this.accuracy = accuracy;
        this.strengthValue = strengthValue;
    }
    public ReconnaissanceBean setReconnaissanceBean(JReconnaissanceBean bean){
        this.type = bean.type;
        this.isnewbulid = bean.isnewbulid;
        this.currentPt = getLat(bean.currentPt);
        this.altitude = bean.altitude;
        this.accuracy = bean.accuracy;
        this.strengthValue = bean.strengthValue;
        this.pointType = bean.pointType;
        this.pointName = bean.pointName;
        return this;
    }
    public LatLng getLat(LatLngBean bean){
        try{

            return new LatLng(bean.latitude,bean.longitude);
        }catch (Exception e){
            return null;
        }
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isnewbulid() {
        return isnewbulid;
    }

    public void setIsnewbulid(boolean isnewbulid) {
        this.isnewbulid = isnewbulid;
    }

    public LatLng getCurrentPt() {
        return currentPt;
    }

    public void setCurrentPt(LatLng currentPt) {
        this.currentPt = currentPt;
    }

    public String getAltitude() {
//        if (altitude==null||altitude.length()==0){
//            return "646";
//        }
        return altitude;
    }

    public void setAltitude(String altitude) {
        this.altitude = altitude;
    }

    public String getAccuracy() {
        return accuracy;
    }

    public void setAccuracy(String accuracy) {
        this.accuracy = MyDecimalFormat.getDouble(Double.parseDouble(accuracy),"0.0");
    }

    public String getStrength() {
        return strength;
    }

    public void setStrength(String strength) {
        this.strength = strength;
    }

    public String getStrengthValue() {
        return strengthValue;
    }

    public void setStrengthValue(String strengthValue) {
        this.strengthValue = strengthValue;
    }
}
